<template>

	<view class="page">
		<customNavBar1 title="订单填写" style='color: #111 !important;'></customNavBar1>
		<view class="hander-one" :style="{ 'padding-top': (mt) + 'px' }">
			<view class="info">
				<view class="name">{{ fromData.sail.jointName }} </view>
				<view class="botaInfo">
					<view class="tit">船票信息</view>
					<view class="p">
						<text>{{ timeStr }}</text>
						<text>{{ weeks[dateInfo.week] }} </text>
						<text>{{ boatInfo.sailTime }}</text> 出发
						<view class="timeIcon">
							<u-icon name="clock" :label="boatInfo.info.timeMemosStr" labelColor="#808080"
								labelSize="13px" size="28"></u-icon>
						</view>
					</view>
					<view class="p" style="margin: 24rpx 0 30rpx;">
						<text>{{ info.startPortName }}</text>-
						<text>{{ info.endPortName }}</text>
					</view>
					<view class="subInfo">
						<text>{{ boatInfo.info.lineNum+''+boatInfo.info.sx}}次</text>
						<text>{{ boatInfo.clxm }}</text>
						<text>{{ cabinInfo.className }} </text>
					</view>
					<view class="tit" style="padding-top: 24rpx;
							border-top: 1rpx solid #EFEFEF;
							margin-top: 24rpx;">景点门票信息</view>
					<view class="p">
						<text>{{ timeStr2 }}</text>
						<text>{{ weeks[dateInfo.week2] }} </text>
					</view>
				</view>
			</view>
		</view>
		<view class="notice_info">
			<u-icon name="info-circle" color="#FEA400" size="32rpx"></u-icon>
			<text>免票儿童也须购票。每一成人旅客可免费携带(未满6周岁或身高1.2米以下)的儿童2人，请您在购票的同时登记携童实名信息。超过2人时，应按超过的人数购买半价票。</text>
		</view>
		<!-- 添加乘客 -->
		<view class="person" style="padding-bottom: 24rpx;">
			<text>乘客信息 <text
					style="font-size: 24rpx ; color: #999999; margin: 0 20rpx;">最多可添加{{ personLimit }}人</text></text>
			<view class="p_add" @click="toAddPassenger">
				<image src="https://i.ringzle.com/file/20240415/5f00b972fc0e4e3da82e16f726cb2468.png" mode="">
				</image>
				<text style="font-size: 26rpx;">添加乘客</text>
			</view>
			<!-- 游客信息 -->
			<view class="chekedPerson">
				<view class="p_item_new" v-for="(item, index) in fromData.sailTicket" :key="index">
					<view class="pin_top">
						<image class="p_del" src="@/static/index/steamerTicket/icon_delete.jpg"
							@tap="minus(index, item)">
						</image>
						<view class="pint_right">
							<view class="pintr_info">
								<text class="name">{{ item.realNameCopy || item.passengerNameCopy }}</text>
								<text class="card">{{ cardCfg[item.cardType] }} {{ item.idCodeCopy }}</text>
								<!-- <view class="type">{{typeCfg[item.personType]||''}}</view> -->
							</view>
							<view class="pintr_add" v-if="item.personType == 1">
								<text>携带免票儿童：{{ (item.mpChildList && item.mpChildList.length) || 0 }}</text>
								<view class="add" @tap="addMpChild(item, index)"><span>+</span><text>添加</text></view>
							</view>
						</view>
					</view>
					<view class="pin_childs" v-if="item.mpChildList && item.mpChildList.length > 0">
						<view class="pc_item" v-for="(mpc, idx) in item.mpChildList" :key="idx">
							<text class="title">携童{{ idx + 1 }}</text>
							<text class="name">{{ mpc.nameCopy }}</text>
							<text class="card">{{ cardCfg[mpc.cardType] }} {{ mpc.cardCopy }}</text>
							<view class="type">{{ typeCfg[mpc.personType] || '' }}</view>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="person">
			<view class="tit" style="margin-bottom:22rpx">联系人信息</view>
			<u-cell-group class="cellBox" :border="false">
				<u-cell>
					<text slot="icon" style="font-size: 28rpx;margin-left:-40rpx"><text class="red">*</text>联系人</text>
					<view slot="title" class="title">
						<u--input border="none" @blur="setName" @confirm="setName" class="input"
							placeholderStyle="font-size:26rpx;text-align:right" inputAlign="right"
							placeholder="请填写联系人信息" v-model="PassengersName"></u--input>
					</view>
				</u-cell>
				<u-cell>
					<text slot="icon" style="font-size: 28rpx;margin-left:-40rpx"><text class="red">*</text>手机号码</text>
					<view slot="title" class="title">
						<u--input border="none" class="input" placeholderStyle="font-size:26rpx;text-align:right"
							inputAlign="right" v-model="fromData.sail.linkMobileCopy" placeholder="请填写手机号"></u--input>
					</view>
				</u-cell>
				<u-cell isLink :border="false" rightIconStyle="font-size:24rpx" @click="couponList">
					<text slot="icon" class="icon" style="margin-left:-40rpx">券</text>
					<view slot="title" class="titlecell">
						<text style="font-size: 26rpx;">优惠券</text>
						<text style="width: 100rpx;
								display: inline-block;
								flex:1;
								text-align: right;
								font-size: 26rpx;
								color: #AAA;" v-if="coupon.length==0">暂未选择优惠券</text>
						<text style="width: 100rpx;
								display: inline-block;
								flex:1;
								text-align: right;
								font-size: 26rpx;
								color: #AAA;" v-else>{{coupon.name}}</text>
					</view>
				</u-cell>
			</u-cell-group>
		</view>
		<view class="operation">
			<view class="left">
				<text>合计</text>
				<text>￥</text>
				<!-- <text>{{ totalMoney }}</text> -->
				<text class="b_span" v-if="coupon.length==0">{{Math.round(totalMoney * 100) / 100}}</text>
				<text class="b_span" v-else-if="coupon.length!=0&&totalMoney>coupon.price">{{Math.round((totalMoney - coupon.price)*100)/100}}</text>
				<text class="b_span" v-else>0.01</text>
				<!-- <text>已减 ¥{{fromData.sail.discountAmount}}</text> -->
			</view>
			<view class="right">
				<u-icon v-if="feeShow" name="arrow-up" label="明细" space="12" labelColor="#666" labelSize="24"
					customStyle="color:#666" label-pos="left" @click="showTicketMx"></u-icon>
				<u-icon v-else name="arrow-down" label="明细" space="12" labelColor="#666" labelSize="24"
					customStyle="color:#666" label-pos="left" @click="showTicketMx"></u-icon>
				<text @click="btnSail" style="margin-right: 45rpx">提交订单</text>
			</view>
		</view>
		<!-- 添加乘客 -->
		<u-popup :show="addShow" @close="addShow = false">
			<view class="details">
				<view class="title">
					<text>游客信息</text>
					<image src="@/static/index/steamerTicket/icon_close.png" @tap="addShow = false"></image>
				</view>
				<view class="has_info">
					<view class="add_user" @tap="addPerson">
						<image src="https://i.ringzle.com/file/20240222/a3f02bedd00b4995aa938341af1b454e.png" mode="">
						</image>
						<text>新增</text>
					</view>
					<view class="add_list" v-if="addList.length > 0">
						<u-swipe-action>
							<u-swipe-action-item :options="options" v-for="(item, index) in addList" :key="index"
								@click="deletePerson(item)" :ref="'swipeAction' + index" v-if="item.passengerName">
								<view class="swipe-action u-border-top u-border-bottom">
									<view class="swipe-action__content">
										<view class="sac_item">
											<image class="chk" @tap="selectPerson(index, item)"
												:src="item.isSelect ? 'https://i.ringzle.com/file/20240318/914f08290ea9411c902c294151d74b71.png' : 'https://i.ringzle.com/file/20231027/db588133d67548fc82dfb0d128eac9a8.png'" />
											<view class="si_info">
												<view class="name">
													<view>{{ item.passengerNameCopy }}</view>
													<!-- <view>{{ typeCfg[item.personType] }}</view> -->
												</view>

												<view class="idcard">
													<text>{{ cardCfg[item.cardType] }}</text>
													<text>{{ item.cardCopy }}</text>
												</view>
											</view>
											<image class="edit" src="@/static/my/commonInformation/icon_edit.png"
												@tap="toEdit(item)">
											</image>
										</view>
									</view>
								</view>
							</u-swipe-action-item>
						</u-swipe-action>
					</view>
				</view>
				<view class="add_submit" @tap="confirmAdd">确定</view>
			</view>
		</u-popup>
		<!-- 费用明细 -->
		<u-popup :show="feeShow" @close="close2" customStyle="border-radius:24rpx 24rpx 0 0">
			<view class="feeDetail">
				<view class="tit">
					<text>费用明细</text>
					<u-icon name="close-circle" size="40" color="#999" @click="close2()"></u-icon>
				</view>
				<view class="list">
					<view class="part">
						<view class="t"><text>船票</text></view>
						<view class="li" v-for="(item, ind) in shipOrder.foreOrderItemReqs" :key="ind">
							<text>{{ item.passName | tuomi }}-{{ typeCfg[item.priceType] }}-{{ item.seatClassName }}</text>
							<text>¥{{ item.realFee }}</text>
						</view>
						<view class="li" v-if="mpTicketNum">
							<text>免票儿童</text>
							<text>¥0*{{ mpTicketNum }}</text>
						</view>
					</view>
					<view class="part">
						<!-- 景区1：成人，2老人，3:儿童 -->
						<view class="t"><text>景区门票</text></view>
						<view class="li" v-for="(item, ind) in fromData.sailTicket" :key="ind">
							<text v-if="menpiaoId === '273'">{{ item.realName | tuomi }}-{{ JIHUpersonTypehandle(item.age) == 1 ?
								'成人票' : JIHUpersonTypehandle(item.age) == 3 ? '儿童票' : '老人票' }}</text>
							<text v-else>{{ item.realName | tuomi }}-{{ personTypehandle(item.age) == 1 ? '成人票' :
								personTypehandle(item.age)
									== 3 ? '儿童票' : personTypehandle(item.age) == 2 ? '老人票' : '免票' }}</text>
							<!-- <text>¥{{ personTypehandle(item.age) == 1 ? total : (item.age) == 4 ? 0 : (total / 2) }}</text> -->
							<text v-if="menpiaoId === '273'">¥{{ JIHUpersonTypehandle(item.age) === 1 ? showTotal :
								JIHUpersonTypehandle(item.age) === 3 ? showTotalChild : showTotalOldpeople
								}}</text>
							<text v-else>¥{{ personPricehandle(item.age) }}</text>
						</view>
					</view>
					<view class="part" v-if="coupon.length!=0">
						<view class="t"><text>优惠券抵扣</text>
						<view class="li" >
							<text>¥-{{ coupon.price }}</text>
						</view>
						</view>
						
						
					</view>
					<view class="part">
						<view class="t">
							<text>合计</text>
							<text class="red" v-if="coupon.length==0">{{Math.round(totalMoney * 100) / 100}}</text>
							<text class="red" v-else-if="coupon.length!=0&&totalMoney>coupon.price">{{Math.round((totalMoney - coupon.price)*100)/100}}</text>
							<text class="red" v-else>0.01</text>
							
						</view>
					</view>
				</view>
			</view>
			<view class="operation">
				<view class="left">
					<text>合计</text>
					<text>￥</text>
					<!-- <text>{{ totalMoney }}</text> -->
					<text v-if="coupon.length==0">{{Math.round(totalMoney * 100) / 100}}</text>
					<text v-else-if="coupon.length!=0&&totalMoney>coupon.price">{{Math.round((totalMoney - coupon.price)*100)/100}}</text>
					<text v-else>0.01</text>
					<!-- <text>已减 ¥{{fromData.sail.discountAmount}}</text> -->
				</view>
				<view class="right">
					<u-icon name="arrow-up" label="明细" space="12" labelColor="#666" labelSize="24"
						customStyle="color:#666" label-pos="left" @click="feeShow = false"></u-icon>
					<text @click="btnSail" style="margin-right: 45rpx">提交订单</text>
				</view>
			</view>
		</u-popup>
		<!-- 授权 -->
		<GetPhoneNumber ref="phoneNumber"></GetPhoneNumber>
		<!-- 微信支付 -->
		<WechatPay ref="wxPay" @confirmPay="toPay" @cancelPay="cancelPay"></WechatPay>
		<!-- 预订时免票儿童提示 -->
		<view class="local_box" v-if="mpTipShow" :style="{ 'height': (h) + 'px' }">
			<view class="lb_content">
				<view class="lbc_tip">免票儿童需购买<span style="font-weight: bolder;">0元票</span>，请确认是否已添加出行儿童信息，以免耽误行程。</view>
				<view class="lbc_btns">
					<view class="lb_qx" @tap="mpTipShow = false">取消</view>
					<view class="lb_qd" @tap="confirmMpAdd">确定</view>
				</view>
				<image src="https://i.ringzle.com/file/20240429/1876883b5065422a9d5b96518f421ed8.png"></image>
			</view>
		</view>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	var that;
	import customNavBar1 from "@/compoments/uNavBar1/index2.vue";
	import WechatPay from '@/compoments/wechatPay/index.vue'
	import GetPhoneNumber from "@/compoments/Getphonenumber/index.vue";

	export default {
		components: {
			WechatPay,
			customNavBar1,
			GetPhoneNumber,
		},
		data() {
			return {
				h: uni.getSystemInfoSync().windowHeight,
				mt: uni.getSystemInfoSync().statusBarHeight + 44,
				titleHeader: "套票专区",
				show: false,
				addShow: false,
				orderId: "",
				orderCode: "",
				options: [{
					text: "删除",
					style: {
						backgroundColor: "#f56c6c",
					},
				}, ],
				addList: [],
				fromData: {
					sail: {
						jointName: "",
						ticketId: 0,
						discountAmount: 0,
						linkMobile: "",
						linkMobileCopy: "",
						linkName: "",
						linkNameCopy: "",
						num: 1,
						orderAmount: 0,
						realityPay: 0,
					},
					sailTicket: [],
				},
				weeks: ["周日", "周一 ", "周二", "周三", "周四", "周五", "周六"],
				checkTime: "",
				checkTime2: "",
				totalMoney: 0,
				shipOrder: {},
				id: "",
				jointName: "",
				total: 0,
				boatInfo: {},
				cabinInfo: {},
				dateInfo: {},
				info: {
					startPortName: "",
					endPortName: "",
				},
				typeCfg: {
					1: "成人票",
					2: "儿童票",
					3: "免票儿童",
					// 4: '成人票'
				},
				cardCfg: this.$uct.typeToText,
				timeStr: "",
				timeStr2: "",
				feeShow: false,
				prices: [],

				mpChild: false, //查询乘客信息时是否查免票儿童的数据
				mpIndex: "",
				personLimit: 10, //最多可添加乘客的数量
				mpTipShow: false,
				mpTicketNum: "", //免票儿童票数量
				year: "",
				realTicketList: [],
				menpiaoId: "",
				showTotalChild: 0,
				showTotalOldpeople: 0,
				showTotal: 0,
				PassengersName: '',
				coupon:[]
			};
		},
		filters: {
			tuomi(val, t) {
				return that.$aesTm.tuomin(val, 1);
			},
		},
		watch: {
			// "fromData.sailTicket"(newval, oldval) {
			// },
		},
		onLoad(opt) {
			that = this;
			this.year = new Date().getFullYear();
			this.fromData.sail.ticketId = opt.id;
			this.fromData.sail.jointName = opt.jointName;
			this.total = opt.total; //景点门票单价
			let realTicketList = decodeURIComponent(opt.realTicketList);
			this.realTicketList = JSON.parse(realTicketList);
			console.log('this.realTicketList', this.realTicketList);
			this.menpiaoId = opt.menpiaoId
			const boatInfo = JSON.parse(
				decodeURIComponent(opt.boatInfo ? opt.boatInfo : "null")
			);
			const cabinInfo = JSON.parse(
				decodeURIComponent(opt.cabinInfo ? opt.cabinInfo : "null")
			);
			const info = JSON.parse(decodeURIComponent(opt.info ? opt.info : "null"));
			const dateInfo = JSON.parse(
				decodeURIComponent(opt.dateInfo ? opt.dateInfo : "null")
			);

			this.boatInfo = boatInfo;
			this.cabinInfo = cabinInfo;
			this.info = info;
			this.dateInfo = dateInfo;
			this.checkTime = dateInfo.time;
			this.checkTime2 = dateInfo.time2;
			this.timeStr =
				dateInfo.time.split("-")[0] + "月" + dateInfo.time.split("-")[1] + "日";
			this.timeStr2 =
				dateInfo.time2.split("-")[0] + "月" + dateInfo.time2.split("-")[1] + "日";
			this.fromData.sail.linkMobile = uni.getStorageSync("userInfo") ?
				JSON.parse(uni.getStorageSync("userInfo")).mobile :
				"";
			this.fromData.sail.linkMobileCopy = uni.getStorageSync("userInfo") ?
				JSON.parse(uni.getStorageSync("userInfo")).mobile :
				"";
			this.fromData.sail.playDate = this.year + "-" + this.checkTime2;
		},
		onShow(){
			this.toGetPassengers();
			let that = this
			uni.$on('updateData',function(data){
				console.log(data);
				if(data){
					that.coupon = data
				}else{
					that.coupon = []
				}
				
			})
			
		},
		methods: {
			couponList(){
				uni.navigateTo({
				    url: `/pagesMy/coupon/useList?type=6&price=${Math.round(this.totalMoney * 100) / 100 }`
				});
			},
			setName(e) {
				console.log(e);
				this.PassengersName = e;
				this.fromData.sail.linkName = e;
				this.fromData.sail.linkNameCopy = e;
				console.log(this.fromData.sail);
			},

			personPricehandle(age) {
				// 儿童票
				if (age > 5 && age < 19) {
					return this.showTotalChild;
					// 成人票
				} else if (age > 18 && age < 60) {
					return this.showTotal;
					//老人
				} else if (age > 59 && age < 70) {
					return this.showTotalOldpeople;
				} else { //免票老人（70及以上）
					return 0;
				}
			},
			personTypehandle(age) {
				// 儿童票
				if (age > 5 && age < 19) {
					return 3;
					// 成人票
				} else if (age > 18 && age < 60) {
					return 1;

				} else if (age > 59 && age < 70) {
					return 2;
				} else {
					return 4;
				}
			},
			JIHUpersonTypehandle(age) {
				// 儿童
				if (age > 5 && age < 19) {
					return 3
					//老人
				} else if (age > 59 && age < 70) {
					return 2
				} else {
					return 1
				}
				// showTotalOldpeople
			},
			toAddPassenger() {
				this.addShow = true;
				this.mpChild = false;
				this.toGetPassengers(() => {
					this.addList.forEach((d, i) => {
						if (this.fromData.sailTicket.find((p) => p.card == d.card))
							this.$set(this.addList[i], "isSelect", true);
						else this.$set(this.addList[i], "isSelect", false);
					});
				});
			},
			//关闭支付弹框
			closePay() {
				this.$refs.wxPay.payShow = false;
				setTimeout(() => {
					uni.redirectTo({
						url: "/pagesMy/order/index?name=船票+景点&type=0&typeIndex=4",
					});
				}, 1000);
			},
			toPay() {
				this.$login().then((res) => {
					if (res === 0) return this.confrimPay();
					else this.$refs["phoneNumber"].show = true;
				});
			},
			cancelPay() {
				uni.redirectTo({
					url: '/pagesTrip/packageArea/order?orderCode=' + this.orderId
				})
			},
			confrimPay() {
				this.$api
					.post(
						"/order/icbc/createOrder", {
							orderCode: this.orderCode,
							tradeType: "JSAPI",
							openId: JSON.parse(uni.getStorageSync("userInfo")).openId,
						},
						false
					)
					.then((res) => {
						if (res.statusCode == 200 && res.data != null) {
							this.$refs.wxPay.payShow = false;
							this.$wxPay(res.data).then((result) => {
								uni.showToast({
									title: "支付成功",
								});
								uni.navigateTo({
									url: "/pagesTrip/packageArea/paySuccess?realityPay=" +
										this.totalMoney +
										"&orderId=" +
										this.orderId,
								});
							});
						}
					});
			},

			close2() {
				this.$set(this, "feeShow", false);
			},
			//计算价格明细
			computedPrice() {
				//   船票信息
				let shipOrderInfo = this.boatInfo.info;
				let seatClasses = this.cabinInfo;
				this.shipOrder = {
					...shipOrderInfo,
				};
				this.shipOrder.timeMemos = this.boatInfo.info.timeMemosStr;
				this.shipOrder.contactNum = this.fromData.sail.linkMobileCopy;
				this.shipOrder.linkPerson = this.fromData.sail.linkNameCopy;
				this.shipOrder.linkPhone = this.fromData.sail.linkMobileCopy;
				this.shipOrder.sailDate = this.year + "-" + this.checkTime;
				let teTime = new Date().setMinutes(new Date().getMinutes() + 5);
				this.shipOrder.expireTime = new Date(teTime).Format(
					"yyyy-MM-dd hh:mm:ss"
				);
				this.shipOrder.openId = JSON.parse(uni.getStorageSync("userInfo")).openId;
				this.shipOrder.totalFee =
					parseFloat(seatClasses.totalPrice) * this.fromData.sailTicket.length; //船票单价*人数（原价）
				this.shipOrder.totalPayFee = this.prices.reduce(
					(prev, curr) => prev + curr
				); //实际支付船票价格(数组求和)
				this.shipOrder.foreOrderItemReqs = []; //船票的游客信息集合
				//this.fromData.sailTicket=[];
				console.log(this.fromData.sailTicket)
				let sailTicket = JSON.parse(JSON.stringify(this.fromData.sailTicket));
				sailTicket.forEach((d, index) => {
					this.shipOrder.foreOrderItemReqs.push({
						passName: d.realName,
						priceType: d.personType,
						credentialNum: d.card,
						realFee: this.prices[index],
						passId: 193,
						freeChildCount: d.childs,
						ticketFee: seatClasses.totalPrice,
						seatClassName: seatClasses.className || "",
						credentialType: d.cardType,
						seatClass: seatClasses.classNum || "",
						isLocal: d.isLocalType,
						plateNum: "",
						freeChildInfo: d.mpChildList.map((m) => {
							return {
								parentCredential: this.$aesTm.encrypt(d.card, 3),
								childName: this.$aesTm.encrypt(m.passengerName, 1),
								card: this.$aesTm.encrypt(m.card, 3),
								type: m.cardType || 1,
							};
						}),
						"ticPrice":seatClasses.ticPrice||''
					});
				});
				this.fromData.sailTicket.forEach((item) => {
					item.playDate = this.checkTime2
				})
				//   景区门票信息
				this.fromData.sail.num = this.fromData.sailTicket.length;
				this.fromData.sail.orderAmount =
					this.totalMoney - this.shipOrder.totalPayFee; //总价减去船票实际价格
				this.fromData.sail.realityPay = this.fromData.sail.orderAmount;
			},
			btnSail() {
				if (this.fromData.sailTicket.length == 0) {
					return this.$showToast("请添加乘客");
				}
				if (!this.fromData.sail.linkNameCopy)
					return this.$showToast("请填写联系人姓名");

				if (!this.$reg.mobile(this.fromData.sail.linkMobileCopy))
					return this.$showToast("请填写正确的联系人手机号");
				//计算价格明细
				this.computedPrice();
				let exitMp = this.fromData.sailTicket.find(
					(p) => p.mpChildList.length > 0
				);
				if (!exitMp) return (this.mpTipShow = true);
				this.toCreateOrder();
			},
			toCreateOrder() {
				let newShipOrder = JSON.parse(JSON.stringify(this.shipOrder));
				newShipOrder.contactNum = this.$aesTm.encrypt(newShipOrder.contactNum);
				newShipOrder.linkPerson = this.$aesTm.encrypt(newShipOrder.linkPerson);
				newShipOrder.linkPhone = this.$aesTm.encrypt(newShipOrder.linkPhone);
				newShipOrder.foreOrderItemReqs.forEach((d) => {
					d.credentialNum = this.$aesTm.encrypt(d.credentialNum);
					d.passName = this.$aesTm.encrypt(d.passName);
				});
				let newFromData = JSON.parse(JSON.stringify(this.fromData));
				newFromData.linkMobile = this.$aesTm.encrypt(newFromData.linkMobile);
				newFromData.linkName = this.$aesTm.encrypt(newFromData.linkName);
				newFromData.sail.linkMobile = this.$aesTm.encrypt(
					newFromData.sail.linkMobileCopy
				);
				newFromData.sail.linkName = this.$aesTm.encrypt(
					newFromData.sail.linkNameCopy
				);
				delete newFromData.sail.linkMobileCopy;
				delete newFromData.sail.linkNameCopy;
				newFromData.sailTicket.forEach((d) => {
					d.card = this.$aesTm.encrypt(d.card);
					d.idCode = this.$aesTm.encrypt(d.idCode);
					d.name = this.$aesTm.encrypt(d.name);
					d.realName = this.$aesTm.encrypt(d.realName);
					delete d.idCodeCopy;
					delete d.realNameCopy;
					delete d.cardCopy;
					delete d.passengerName;
					delete d.passengerNameCopy;
					delete d.mpChildList;
				});
				this.$api
					.post("/api/shipScenic/createOrder", {
						shipOrder: newShipOrder,
						submitOrderDto: newFromData,
						jointId: newFromData.sail.ticketId,
						discountCouponUserId:this.coupon.id
					})
					.then((res) => {
						if (res.data.code == 0) {
							if (res.data.data) {
								if (res.data.data.remark) {
									let sArr = res.data.data.remark.split(',').map(item=>{
										if(item){
											return this.$aesTm.decrypt(item)
										}
									});
									console.log(sArr)
									let names = sArr.join(',');
									names=names.substring(0,names.length-1)
									uni.showModal({
										title:'提示',
										content: `${names}符合该景区免票政策，携带身份证即可前往游玩。`,
										confirmText: "确定",
										showCancel: false,
										success: (ress) => {
											//this.$showToast()
											this.orderId = res.data.data.id;
											this.orderCode = res.data.data.orderCode;
											this.$refs.wxPay.payShow = true;
										}
									})
								} else {
									this.$showToast()
									this.orderId = res.data.data.id;
									this.orderCode = res.data.data.orderCode;
									this.$refs.wxPay.payShow = true;
								}

							} else {
								this.$showModal(res.data.msg);
							}
						} else {
							uni.showToast({
								title: res.data.msg,
								icon: "none",
							});
						}
					})
					.catch((res) => {
						this.fromData.sail.sailTicket = [];
					});
				this.$store.commit("packageAreaSubmit", {
					shipOrder: this.shipOrder,
					submitOrderDto: this.fromData,
				});
			},
			async confirmAdd() {
				this.coupon = []
				if (!this.mpChild) {
					let temp = this.addList.filter((d) => d.isSelect == true);
					if (temp.length == 0) this.fromData.sailTicket = [];
					else {
						let clone = JSON.parse(JSON.stringify(this.fromData.sailTicket));
						this.fromData.sailTicket = new Array(temp.length);
						temp.forEach((t, i) => {
							let _t = clone.find((c) => c.card == t.card);
							if (_t) this.fromData.sailTicket[i] = _t;
							else this.fromData.sailTicket[i] = t;
						});
					}

					if (this.fromData.sailTicket.length == 0)
						return this.$showToast("请至少添加一名乘客");
					let pcount = this.fromData.sailTicket.length;
					let ccount = 0;
					this.fromData.sailTicket.forEach(
						(p) => (ccount += p.mpChildList ? p.mpChildList.length : 0)
					);
					if (pcount + ccount > this.personLimit)
						return this.$showToast("最多可添加" + this.personLimit + "名乘客");
					
					let promise = this.fromData.sailTicket.map(async (d,i)=>{
						d.realName = d.passengerName;
						d.realNameCopy = this.$aesTm.tuomin(d.passengerName, 1);
						d.idCode = d.card;
						d.idCodeCopy = this.$aesTm.tuomin(d.card, 3);
						if (
							!this.fromData.sailTicket[i].mpChildList ||
							this.fromData.sailTicket[i].mpChildList.length == 0
						) {
							this.$set(this.fromData.sailTicket[i], "mpChildList", []);
						}
						let newCard = JSON.parse(JSON.stringify(d.card));
						await this.getPassagerIolocal(d.cardType,newCard,i)
					})
					await Promise.all(promise);
					let that = this;
					setTimeout(function() {
						that.delTotalPrice(that.fromData.sailTicket);
					}, 1000);

					this.fromData.linkName = this.fromData.sailTicket[0].passengerName;
					this.PassengersName = this.fromData.sailTicket[0].passengerName;
					this.fromData.sail.linkName = this.fromData.sailTicket[0].passengerName;
					this.fromData.sail.linkNameCopy = this.fromData.sailTicket[0].passengerName;
					this.fromData.linkMobile = JSON.parse(
						uni.getStorageSync("userInfo")
					).mobile;
					this.addShow = false;

				} else {
					let list = this.addList.filter((d) => d.isSelect == true);
					let pcount = this.fromData.sailTicket.length;
					let ccount = 0;
					this.fromData.sailTicket.forEach(
						(p) => (ccount += p.mpChildList.length)
					);
					let currentNum =
						this.fromData.sailTicket[this.mpIndex].mpChildList.length;
					if (pcount + ccount + list.length - currentNum > this.personLimit)
						return this.$showToast("最多可添加" + this.personLimit + "名乘客");

					list.forEach((d, i) => {
						d.nameCopy = this.$aesTm.tuomin(d.passengerName, 1);
						d.cardCopy = this.$aesTm.tuomin(d.card, 3);
					});
					if (this.mpIndex !== "")
						this.$set(
							this.fromData.sailTicket[this.mpIndex],
							"mpChildList",
							list
						);
					this.addShow = false;
				}
			},
			getPassagerIolocal(credentialType,newCard,i){
				return new Promise((resolve,reject)=>{
					this.$api.post('/travel/ship/ticket/passager/iolocal', {
						credentialType,
						credentialNum: this.$aesTm.encrypt(newCard)
					}).then(res => {
						if (res.data.code === 0) {
							this.$set(this.fromData.sailTicket[i], "isLocalType", res.data.data || 0);
							resolve();
						} else this.$showModal(res.data.msg);
					})
				})
			},
			getYearOld(idCard) {
				// 先计算出出生日期
				var re_eighteen = /^(\d{6})(\d{4})(\d{2})(\d{2})(\d{3})([0-9]|X)$/;
				var arr_data = idCard.match(re_eighteen);
				var year = arr_data[2];
				var month = arr_data[3];
				var day = arr_data[4];
				const newYear = `${year}-${month}-${day}`;
				// 当前时间
				var today = new Date();
				// 出生日期
				var birthDate = new Date(newYear);
				var age = today.getFullYear() - birthDate.getFullYear();
				var monthDiff = today.getMonth() - birthDate.getMonth();
				// 如果当前月份小于出生月份，或者两个月份相同但当前日期小于出生日期，则年龄减一
				if (
					monthDiff < 0 ||
					(monthDiff === 0 && today.getDate() < birthDate.getDate())
				) {
					age--;
				}
				return age;
			},
			delTotalPrice(data) {
				//船票价格集合，下单时用
				this.totalMoney = 0;
				this.prices = [];
				//	this.totalMoney =parseFloat(this.total) * data.length;
				//船票根据类型计算对应价格
				for (let index = 0; index < data.length; index++) {
					if (data[index].isLocalType == "1") {
						//本地人
						//船票价格根据persontype 判断是否儿童
						if (data[index].personType == 2) {
							//儿童价
							this.totalMoney += parseFloat(this.cabinInfo.localHalfPrice);
							this.prices.push(this.cabinInfo.localHalfPrice);
						} else if (
							data[index].personType == 1 ||
							data[index].personType == 4
						) {
							//成人价
							this.totalMoney += parseFloat(this.cabinInfo.localPrice);
							this.prices.push(this.cabinInfo.localPrice);
						}
						console.log(data[index])
						//景区门票价格 ，儿童和老人是半价 儿童界定年龄是（6-18），老人（60-69）
						let yearOld = data[index].age;
						//let yearOld = this.getYearOld(data[index].idCode);
						// 半价 基湖沙滩
						if (this.menpiaoId === '273') {
							if (yearOld > 5 && yearOld < 19) {
								this.total = this.realTicketList.filter(i => i.ticketType === 3)[0].realPrice
								//基湖本地儿童
								this.showTotalChild = this.total
								this.totalMoney += parseFloat(this.total);
								// 成人
							} else if (yearOld > 59 && yearOld < 70) {
								let innerAry = this.realTicketList.filter(i => i.ticketType === 2)
								// this.showTotalOldpeople = this.realTicketList.filter(i => i.ticketType === 2)[0].realPrice
								this.showTotalOldpeople = innerAry.length > 0 ? innerAry[0].realPrice : this.realTicketList
									.filter(i => i.ticketType === 1)[0].realPrice
								//基湖本地老人
								this.totalMoney += parseFloat(this.showTotalOldpeople);
							} else if (yearOld > 18 && yearOld < 60) {
								this.total = this.realTicketList.filter(i => i.ticketType === 1)[0].realPrice
								//基湖本地成人
								this.showTotal = this.total

								this.totalMoney += parseFloat(this.total);
							}
						} else {
							if ((yearOld > 5 && yearOld < 19)) {
								this.total = this.realTicketList.filter(i => i.ticketType === 3)[0].realPrice
								//其他景区本地儿童
								this.showTotalChild = this.total
								this.totalMoney += parseFloat(this.total);
							} else if (yearOld > 59 && yearOld < 70) {
								this.showTotalOldpeople = this.realTicketList.filter(i => i.ticketType === 2)[0].realPrice
								//其他景区本地老人
								this.totalMoney += parseFloat(this.showTotalOldpeople);
							} else if (yearOld > 18 && yearOld < 60) {
								this.total = this.realTicketList.filter(i => i.ticketType === 1)[0].realPrice
								//其他景区本地成人
								this.totalMoney += parseFloat(this.total);
								this.showTotal = this.total

							}
						}
					} else {
						//外地人
						//船票价格根据persontype 判断是否儿童
						if (data[index].personType == 2) {
							//儿童价
							this.totalMoney += parseFloat(this.cabinInfo.halfPrice);
							this.prices.push(this.cabinInfo.halfPrice);
						} else if (
							data[index].personType == 1 ||
							data[index].personType == 4
						) {
							//成人价
							this.totalMoney += parseFloat(this.cabinInfo.totalPrice);
							this.prices.push(this.cabinInfo.totalPrice);
						}
						//景区门票价格 ，儿童和老人是半价 儿童界定年龄是（6-18），老人（60-69）
						console.log(data[index])
						let yearOld = data[index].age;
						//let yearOld = this.getYearOld(data[index].idCode);
						// 基湖
						if (this.menpiaoId === '273') {
							if (yearOld > 5 && yearOld < 19) {
								this.total = this.realTicketList.filter(i => i.ticketType === 3)[0].realPrice
								//基湖外地儿童
								this.showTotalChild = this.total
								this.totalMoney += parseFloat(this.total);
							} else if (yearOld > 59 && yearOld < 70) {
								let innerAry = this.realTicketList.filter(i => i.ticketType === 2)
								// this.showTotalOldpeople = this.realTicketList.filter(i => i.ticketType === 2)[0].realPrice
								this.showTotalOldpeople = innerAry.length > 0 ? innerAry[0].realPrice : this.realTicketList
									.filter(i => i.ticketType === 1)[0].realPrice
								//基湖外地老人
								this.totalMoney += parseFloat(this.showTotalOldpeople);
							} else if (yearOld > 18 && yearOld < 60) {
								this.total = this.realTicketList.filter(i => i.ticketType === 1)[0].realPrice
								//基湖外地成人
								this.showTotal = this.total
								this.totalMoney += parseFloat(this.total);
							}
							// 其他景区
						} else {
							if ((yearOld > 5 && yearOld < 19)) {
								this.total = this.realTicketList.filter(i => i.ticketType === 3)[0].realPrice
								//其他景区外地儿童
								this.totalMoney += parseFloat(this.total);
								this.showTotalChild = this.total

							} else if (yearOld > 59 && yearOld < 70) {
								this.showTotalOldpeople = this.realTicketList.filter(i => i.ticketType === 2)[0].realPrice
								//其他景区外地老人
								this.totalMoney += parseFloat(this.showTotalOldpeople);
							} else if (yearOld > 18 && yearOld < 60) {
								this.total = this.realTicketList.filter(i => i.ticketType === 1)[0].realPrice
								//其他景区外地成人
								this.showTotal = this.total
								this.totalMoney += parseFloat(this.total);
							}
						}
					}
				}
				this.computedPrice();
			},
			selectPerson(index, item) {
				if (this.mpChild) {
					if (item.mpSelected) return this.uToastShow("该免票儿童已添加");
					else {
						this.$set(
							this.addList[index],
							"isSelect",
							!this.addList[index].isSelect
						);
						let sLen = this.addList.filter((a) => a.isSelect).length;
						if (item.isSelect && sLen > 2) {
							return this.uToastShow(
								"每一成人旅客可免费携带(未满6周岁或身高1.2米以下)的儿童2人，超过2人时，应按超过的人数购买半价票。"
							);
						}
					}
					return;
				}

				this.$set(this.addList[index], "isSelect", !this.addList[index].isSelect);
			},
			minus(index) {
				this.coupon = []
				this.fromData.sailTicket.splice(index, 1);
				this.delTotalPrice(this.fromData.sailTicket);
			},
			deletePerson(item) {
				this.$api.del("/api/commonPerson", [item.id]).then((res) => {
					if (res.data.code === 0) {
						this.addList.forEach((d, i) => {
							this.$refs["swipeAction" + i][0].closeHandler();
						});
						this.toGetPassengers();
						let fidx = this.fromData.sailTicket.findIndex((d) => d.id == item.id);
						if (fidx > -1) this.fromData.sailTicket.splice(fidx, 1);
					} else this.$showModal(res.data.msg);
				});
			},
			toEdit(item, main) {
				if (main) {
					uni.navigateTo({
						url: "/pagesMy/commonInformation/add?type=ship&main=1&item=" +
							JSON.stringify(item),
						events: {
							editPassengerSuccess: (data) => {
								this.toGetPassengers();
							},
							editPassenger: (data) => {},
						},
					});
				} else {
					uni.navigateTo({
						url: "/pagesMy/commonInformation/add?type=ship&item=" +
							JSON.stringify(item),
						events: {
							editPassengerSuccess: (data) => {
								this.toGetPassengers();
							},
						},
					});
				}
			},
			toGetPassengers(callback) {
				if (!uni.getStorageSync("userInfo")) {
					this.$refs["phoneNumber"].show = true;
				} else {
					this.$api
						.get("/api/commonPerson/list", {
							openId: JSON.parse(uni.getStorageSync("userInfo")).openId,
						})
						.then((res) => {
							if (res.data.code === 0) {
								this.addList = this.$uct.setPersonType(res.data.data, 1);
								if (this.mpChild)
									this.addList = this.addList.filter((l) => l.personType == 3);
								else this.addList = this.addList.filter((l) => l.personType != 3);
								this.addList.forEach((d, i) => {
									d.passengerNameCopy = this.$aesTm.tuomin(d.passengerName, 1);
									d.cardCopy = this.$aesTm.tuomin(d.card, 3);
								});
								callback && callback();
							} else this.$showModal(res.data.msg);
						});
				}
			},
			addPerson() {
				this.$login().then((res) => {
					if (res === 0) {
						uni.navigateTo({
							url: "/pagesMy/commonInformation/add?type=ship",
							events: {
								addPassengerSuccess: (data) => {
									this.toGetPassengers();
								},
							},
						});
					} else this.$refs["phoneNumber"].show = true;
				});
			},
			addMpChild(item, index) {
				this.addShow = true;
				this.mpChild = true;
				this.mpIndex = index;
				this.toGetPassengers(() => {
					let mpTemp = [];
					this.fromData.sailTicket.forEach((p) => {
						p.mpChildList.forEach((mp) => {
							if (!item.mpChildList.find((imp) => imp.card == mp.card))
								mpTemp.push(mp);
						});
					});

					this.addList.forEach((d, i) => {
						if (item.mpChildList.find((p) => p.card == d.card))
							this.$set(this.addList[i], "isSelect", true);
						else this.$set(this.addList[i], "isSelect", false);

						if (mpTemp.find((p) => p.card == d.card))
							this.$set(this.addList[i], "mpSelected", true);
						else this.$set(this.addList[i], "mpSelected", false);
					});
				});
			},
			confirmMpAdd() {
				this.mpTipShow = false;
				this.toCreateOrder();
			},
			showTicketMx() {
				this.feeShow = true;
				this.mpTicketNum = this.fromData.sailTicket.reduce(
					(cur, pre) => cur + pre.mpChildList.length,
					0
				);
			},
			uToastShow(message) {
				this.$refs.uToast.show({
					message
				});
			},
		},
	};
</script>
<style lang="less">
	::v-deep.u-line {
		border-color: #efefef !important;
	}
</style>

<style lang="scss" scoped>
	::v-deep .u-toast {
		position: relative;
		z-index: 10099;
	}



	.local_box {
		width: 100%;
		position: absolute;
		top: 0;
		left: 0;
		background: rgba(0, 0, 0, 0.2);
		z-index: 99999;
		display: flex;
		align-items: center;
		justify-content: center;

		.lb_content {
			width: calc(100% - 146rpx);
			background: url(https://i.ringzle.com/file/20240429/9ca472b33c094035a1d7a00f110ac59d.png) no-repeat;
			background-size: 100% 100%;
			border-radius: 24rpx;
			padding: 143rpx 38rpx 44rpx;
			box-sizing: border-box;
			position: relative;
			z-index: 11;

			.lbc_tip {
				text-align: center;
				font-size: 30rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #333333;
				line-height: 48rpx;
			}

			.lbc_btn {
				width: calc(100% - 48rpx);
				height: 88rpx;
				background: #007a69;
				box-shadow: 0rpx 6rpx 16rpx 0rpx rgba(13, 191, 253, 0.3);
				border-radius: 44rpx;
				line-height: 88rpx;
				text-align: center;
				font-size: 32rpx;
				font-family: PingFang-SC, PingFang-SC;
				font-weight: bold;
				color: #ffffff;
				letter-spacing: 2rpx;
				margin: 63rpx 24rpx 0;
			}

			.lbc_btns {
				width: calc(100% - 76rpx);
				height: 88rpx;
				margin: 63rpx 38rpx 0;
				display: flex;
				justify-content: space-between;

				&>view {
					width: calc(50% - 14rpx);
					height: 100%;
					border-radius: 44rpx;
					display: flex;
					align-items: center;
					justify-content: center;
					font-family: PingFang-SC, PingFang-SC;
					font-weight: bold;
					font-size: 32rpx;

					&.lb_qx {
						border: 1rpx solid #007a69;
						color: #007a69;
					}

					&.lb_qd {
						background: #007a69;
						color: #ffffff;
					}
				}
			}

			image {
				width: 255rpx;
				height: 168rpx;
				position: absolute;
				left: 50%;
				margin-left: -127.5rpx;
				top: -60rpx;
				z-index: 12;
			}
		}
	}

	/deep/.u-input__content__field-wrapper__field {
		font-size: 26rpx !important;
	}

	/deep/.u-cell__body__content {
		align-items: flex-start !important;
	}

	.red {
		color: #f44;
	}

	page,
	.page {
		background-color: #f5f8fa;
		padding-bottom: 120rpx;
	}

	.hander-one {
		background: url("https://i.ringzle.com/file/20240129/323bce42369f4d228d5653b8a4249095.png") top center no-repeat;
		background-size: 100% 80%;
		box-sizing: border-box;
	}

	.info {
		margin-bottom: 20rpx;

		.name {
			font-size: 34rpx;
			font-weight: 600;
			font-family: PingFang-SC-Bold, PingFang-SC;
			color: #111;
			padding: 48rpx 48rpx 20rpx 48rpx;
			line-height: 48rpx;
		}

		.botaInfo {
			width: 700rpx;
			background: #fff;
			margin: 0 auto;
			background: #fff;
			padding: 30rpx 24rpx;
			border-radius: 16rpx;
			box-sizing: border-box;

			.tit {
				color: #999;
				font-size: 32r;
				margin-bottom: 30rpx;
				font-weight: bold;
				line-height: 32rpx;
			}

			.p {
				font-size: 30rpx;
				font-weight: bold;
				position: relative;

				text {
					margin-right: 10rpx;
				}
			}

			.timeIcon {
				position: absolute;
				right: 10px;
				top: 3px;
			}

			.subInfo {
				color: #808080;
				font-size: 24rpx;

				text {
					border-right: 1rpx solid #ccc;
					padding-right: 8px;
					height: 24rpx;
					line-height: 24rpx;
					display: inline-flex;
					margin-right: 12rpx;

					&:last-child {
						border: 0;
					}
				}
			}
		}
	}

	//新增乘客
	.icon {
		border-radius: 6rpx;
		background-color: #ff4141;
		width: 34rpx;
		height: 34rpx;
		color: #fff;
		font-size: 22rpx;
		text-align: center;
		line-height: 34rpx;
		margin-right: 6rpx;
	}

	.titlecell {
		display: flex;
		align-items: center;
	}

	.notice_info {
		width: 100%;
		padding: 20rpx 24rpx;
		box-sizing: border-box;
		background: #fffdf7;
		display: flex;
		align-items: flex-start;
		margin-top: -20rpx;
		margin-bottom: 20rpx;

		text {
			padding-left: 8rpx;
			font-family: PingFangSC, PingFang SC;
			font-weight: 400;
			font-size: 24rpx;
			color: #fea400;
			line-height: 33rpx;
		}
	}

	.person {
		padding: 36rpx 24rpx 1rpx;
		border-radius: 16rpx;
		width: 700rpx;
		background-color: #fff;
		margin: 0 auto 20rpx;
		box-sizing: border-box;

		&>text {
			font-size: 32rpx;
			font-family: PingFang-SC-Bold, PingFang-SC;
			font-weight: bold;
			color: #111111;
		}

		.p_add {
			margin-top: 40rpx;
			display: flex;
			align-items: center;
			justify-content: center;
			// border-radius: 16rpx;
			// border: 1rpx dotted #007A69;
			background-image: url("https://i.ringzle.com/file/20240415/5d72e22d58744b9bb740a3333d3d2b42.png");
			background-repeat: no-repeat;
			background-size: 100% 100%;
			padding: 16rpx;
			background-color: #f0f8f6;

			image {
				width: 26rpx;
				height: 26rpx;
			}

			text {
				font-size: 24rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #007a69;
				margin-left: 8rpx;
			}
		}

		// 联系人信息
		.cellBox {
			.title {
				display: flex;
				align-items: center;
				width: 100%;

				.input {
					padding-left: 10rpx;
					font-size: 26rpx;
				}

				text {
					font-size: 30rpx;
					margin-right: 38rpx;

					&:last-child {
						color: #aaa;
						font-size: 26rpx;
					}
				}
			}
		}

		.tit {
			color: #111;
			font-size: 32rpx;
			margin-bottom: 40rpx;
			font-weight: bold;

			text {
				margin-left: 20rpx;
				color: #999;
				font-size: 24rpx;
				font-weight: inherit;
			}
		}

		.addPerson {
			height: 64rpx;
			border: 1rpx dashed #007a69;
			display: flex;
			justify-content: center;
			align-items: center;
			border-radius: 12rpx;
			background: #f0f8f6;
		}
	}

	// 合计
	.operation {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 0 30rpx;
		background-color: #fff;
		height: 112rpx;
		position: fixed;
		bottom: 0;
		width: 100%;
		z-index: 10;
		box-shadow: 0 -2rpx 8rpx rgba(0, 0, 0, 0.06);

		.left {
			color: #ff4141;
			// margin-top: -28rpx;
			font-size: 24rpx;
			position: relative;

			text {
				vertical-align: middle;
			}

			text:nth-child(1) {
				color: #666;
				margin-right: 16rpx;
			}

			text:nth-child(3) {
				font-size: 48rpx;
			}

			text:nth-child(4) {
				position: absolute;
				font-size: 24rpx;
				color: #aaa;
				bottom: -16rpx;
				left: 0;
			}
		}

		.right {
			display: flex;
			min-width: 200rpx;

			text {
				width: 220rpx;
				height: 80rpx;
				text-align: center;
				line-height: 80rpx;
				color: #fff;
				border-radius: 40rpx;
				margin-left: 24rpx;
				font-size: 32rpx;
				background: #007a69;
			}
		}
	}

	//已选中乘客
	.chekedPerson {
		.p_item_new {
			margin-top: 32rpx;
			padding-bottom: 24rpx;

			.pin_top {
				display: flex;
				align-items: center;

				.p_del {
					width: 36rpx;
					height: 36rpx;
				}

				.pint_right {
					width: calc(100% - 36rpx);
					padding-left: 20rpx;
					box-sizing: border-box;

					.pintr_info {
						display: flex;
						align-items: center;

						.name {
							font-family: PingFang-SC, PingFang-SC;
							font-weight: bold;
							font-size: 30rpx;
							color: #333333;
							line-height: 32rpx;
						}

						.card {
							font-family: PingFangSC, PingFang SC;
							font-weight: 400;
							font-size: 24rpx;
							color: #999999;
							line-height: 24rpx;
							margin-left: 16rpx;
						}

						.type {
							width: 82rpx;
							height: 32rpx;
							background: rgba(0, 122, 105, 0.05);
							border-radius: 8rpx;
							line-height: 32rpx;
							text-align: center;
							font-family: PingFangSC, PingFang SC;
							font-weight: 400;
							font-size: 22rpx;
							color: #94a9c8;
							margin-left: 8rpx;
						}
					}

					.pintr_add {
						margin-top: 32rpx;
						display: flex;
						align-items: center;
						justify-content: space-between;

						text {
							font-family: PingFangSC, PingFang SC;
							font-weight: 400;
							font-size: 28rpx;
							color: #333333;
							line-height: 28rpx;
						}

						.add {
							display: flex;
							align-items: end;

							span {
								color: #007a69;
								font-size: 22rpx;
							}

							text {
								font-family: PingFang-SC, PingFang-SC;
								font-weight: bold;
								font-size: 26rpx;
								color: #007a69;
								line-height: 26rpx;
							}
						}
					}
				}
			}

			.pin_childs {
				margin-top: 32rpx;
				width: 100%;
				padding: 24rpx 20rpx;
				box-sizing: border-box;
				background: #f4f9f8;

				.pc_item {
					margin-top: 24rpx;
					display: flex;
					align-items: center;

					&:first-child {
						margin-top: 0;
					}

					.title {
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						font-size: 20rpx;
						color: #999999;
						line-height: 24rpx;
					}

					.name {
						font-family: PingFang-SC, PingFang-SC;
						font-weight: bold;
						font-size: 28rpx;
						color: #666666;
						line-height: 32rpx;
						margin-left: 19rpx;
					}

					.card {
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						font-size: 24rpx;
						color: #999999;
						line-height: 24rpx;
						margin-left: 16rpx;
					}

					.type {
						width: 92rpx;
						height: 32rpx;
						background: rgba(0, 122, 105, 0.05);
						border-radius: 8rpx;
						margin-left: 12rpx;
						line-height: 32rpx;
						text-align: center;
						font-family: PingFangSC, PingFang SC;
						font-weight: 400;
						font-size: 20rpx;
						color: #94a9c8;
					}
				}
			}
		}
	}

	// 费用明细
	.feeDetail {
		background-color: #fff;
		border-radius: 24rpx 24rpx 0 0;
		// height: 680rpx;
		// overflow: auto;
		padding: 50rpx 30rpx;
		border-bottom: 1px solid #eee;

		.tit {
			display: flex;
			justify-content: space-between;
			margin-bottom: 30rpx;
			text-align: center;

			text {
				&:nth-child(1) {
					font-size: 36rpx;
					color: #333;
					flex: 1;
					font-weight: bold;
				}
			}
		}

		.list {
			height: 640rpx;
			overflow: auto;

			.part {
				padding: 35rpx 0 36rpx;

				&:first-child {
					border-bottom: 1rpx solid #efefef;
				}

				&:last-child {
					margin-top: 60rpx;
				}

				.t {
					display: flex;
					justify-content: space-between;
					align-items: center;
					margin-bottom: 36rpx;
					color: #333;

					text {
						font-weight: bold;
						line-height: 36rpx;

						&:first-child {
							font-size: 32rpx;
						}

						&.red {
							font-size: 36rpx;
							color: #ff4141;
						}
					}
				}

				.li {
					display: flex;
					justify-content: space-between;
					margin-bottom: 10rpx;

					text {
						&:first-child {
							color: #777;
							font-size: 26rpx;
						}

						&:last-child {
							font-weight: bold;
							color: #333;
							font-size: 28rpx;
						}
					}
				}
			}
		}
	}

	// 添加乘客
	.details {
		padding: 40rpx 30rpx 200rpx;

		.title {
			position: relative;
			text-align: center;

			text {
				font-size: 36rpx;
				font-family: PingFang-SC-Bold, PingFang-SC;
				font-weight: bold;
				color: #333333;
			}

			image {
				width: 36rpx;
				height: 36rpx;
				position: absolute;
				right: 10rpx;
				top: 50%;
				margin-top: -18rpx;
			}
		}

		.address {
			font-size: 32rpx;
			font-family: PingFang-SC-Bold, PingFang-SC;
			font-weight: bold;
			color: #333333;
			margin-top: 48rpx;
		}

		.tickets {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 42rpx;

			&>text {
				font-size: 26rpx;
				font-family: PingFangSC-Regular, PingFang SC;
				font-weight: 400;
				color: #777777;
			}

			&>view {
				font-size: 28rpx;
				font-family: PingFang-SC-Bold, PingFang-SC;
				font-weight: bold;
				color: #333333;

				span {
					font-size: 24rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #777777;
				}
			}
		}

		.total {
			display: flex;
			align-items: center;
			justify-content: space-between;
			margin-top: 61rpx;

			text {
				font-size: 32rpx;
				font-family: PingFang-SC-Bold, PingFang-SC;
				font-weight: bold;
				color: #333333;
			}

			view {
				height: 36rpx;
				font-size: 32rpx;
				font-family: PingFang-SC-Bold, PingFang-SC;
				font-weight: bold;
				color: #333333;
			}
		}

		.d_middle {
			padding: 40rpx 0 150rpx;

			&>view {
				display: flex;
				align-items: center;
				justify-content: space-between;
				padding: 40rpx 0;

				&:first-child {
					border-bottom: 1rpx solid #efefef;
				}

				&>text {
					font-size: 28rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #333333;
				}

				&>view {
					font-size: 30rpx;
					font-family: PingFang-SC-Bold, PingFang-SC;
					font-weight: bold;
					color: #333333;
					display: flex;
					align-items: center;

					span {
						font-size: 26rpx;
						font-family: PingFangSC-Regular, PingFang SC;
						font-weight: 400;
						color: #777777;
						margin-left: 10rpx;
					}
				}
			}
		}

		.has_info {
			.add_user {
				height: 88rpx;
				border-radius: 16rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				background: #fff;
				margin-top: 48rpx;
				border: 1rpx dotted #007a69;

				image {
					width: 30rpx;
					height: 30rpx;
					margin-right: 12rpx;
				}

				text {
					font-size: 32rpx;
					font-family: PingFangSC-Regular, PingFang SC;
					font-weight: 400;
					color: #007a69;
					margin-left: 12rpx;
					letter-spacing: 2rpx;
				}
			}

			.add_list {
				padding-top: 30rpx;
				max-height: 478rpx;
				overflow-y: auto;

				.sac_item {
					display: flex;
					align-items: center;
					padding: 36rpx 24rpx;

					.chk {
						width: 38rpx;
						height: 38rpx;
					}

					.si_info {
						width: calc(100% - 96rpx);
						padding-left: 22rpx;

						.name {
							display: flex;
							align-items: center;

							view:first-child {
								font-size: 32rpx;
								font-family: PingFang-SC-Bold, PingFang-SC;
								font-weight: bold;
								color: #111111;
								line-height: 32rpx;
							}

							// view:last-child {
							// 	text-align: center;
							// 	background: #f5f8fa;
							// 	border-radius: 8rpx;
							// 	font-size: 24rpx;
							// 	font-family: PingFangSC-Regular, PingFang SC;
							// 	font-weight: 400;
							// 	color: #94a9c8;
							// 	margin: 5rpx 0 0 28rpx;
							// 	padding: 6rpx 8rpx;
							// 	line-height: 24rpx;
							// }
						}

						.idcard {
							margin-top: 20rpx;

							&>text {
								font-size: 24rpx;
								font-family: PingFangSC-Regular, PingFang SC;
								font-weight: 400;
								color: #111111;
								line-height: 24rpx;

								&:first-child {
									color: #aaaaaa;
									margin-right: 10rpx;
								}
							}
						}
					}

					.edit {
						width: 36rpx;
						height: 36rpx;
					}
				}
			}
		}

		.add_submit {
			width: calc(100% - 60rpx);
			height: 88rpx;
			background: #007a69;
			border-radius: 44rpx;
			position: fixed;
			bottom: 69rpx;
			font-size: 32rpx;
			font-family: PingFang-SC-Bold, PingFang-SC;
			font-weight: bold;
			color: #ffffff;
			line-height: 88rpx;
			text-align: center;
		}
	}
</style>